package com.jy.wms;

import javax.servlet.Filter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import com.joyi.gate.filter.SSOFilter;


@EnableFeignClients
@EnableDiscoveryClient

@SpringBootApplication
@EnableSwagger2
/*
@ComponentScan(basePackages = {"com.joyi"})
*/
@MapperScan("com.jy.wms.dao")
public class WmsApplication {
	@Bean
	public Filter indexFilter(){
		return new SSOFilter();
	}
	@Bean
	public FilterRegistrationBean indexFilterRegistration() {
		FilterRegistrationBean registration = new FilterRegistrationBean(indexFilter());
		registration.addUrlPatterns("*");
		return registration;
	}
	public static void main(String[] args) {
		SpringApplication.run(WmsApplication.class, args);
	}
}
